﻿namespace ch03.binary
{
    public struct OpCodes
    {
        public const byte Unreachable = 0x00; // unreachable
        public const byte Nop = 0x01; // nop
        public const byte Block = 0x02; // block rt in* end
        public const byte Loop = 0x03; // loop rt in* end
        public const byte If = 0x04; // if rt in* else in* end
        public const byte Else_ = 0x05; // else
        public const byte End_ = 0x0B; // end
        public const byte Br = 0x0C; // br l
        public const byte BrIf = 0x0D; // br_if l
        public const byte BrTable = 0x0E; // br_table l* lN
        public const byte Return = 0x0F; // return
        public const byte Call = 0x10; // call x
        public const byte CallIndirect = 0x11; // call_indirect x
        public const byte Drop = 0x1A; // drop
        public const byte Select = 0x1B; // select
        public const byte LocalGet = 0x20; // local.get x
        public const byte LocalSet = 0x21; // local.set x
        public const byte LocalTee = 0x22; // local.tee x
        public const byte GlobalGet = 0x23; // global.get x
        public const byte GlobalSet = 0x24; // global.set x
        public const byte I32Load = 0x28; // i32.load m
        public const byte I64Load = 0x29; // i64.load m
        public const byte F32Load = 0x2A; // f32.load m
        public const byte F64Load = 0x2B; // f64.load m
        public const byte I32Load8S = 0x2C; // i32.load8_s m
        public const byte I32Load8U = 0x2D; // i32.load8_u m
        public const byte I32Load16S = 0x2E; // i32.load16_s m
        public const byte I32Load16U = 0x2F; // i32.load16_u m
        public const byte I64Load8S = 0x30; // i64.load8_s m
        public const byte I64Load8U = 0x31; // i64.load8_u m
        public const byte I64Load16S = 0x32; // i64.load16_s m
        public const byte I64Load16U = 0x33; // i64.load16_u m
        public const byte I64Load32S = 0x34; // i64.load32_s m
        public const byte I64Load32U = 0x35; // i64.load32_u m
        public const byte I32Store = 0x36; // i32.store m
        public const byte I64Store = 0x37; // i64.store m
        public const byte F32Store = 0x38; // f32.store m
        public const byte F64Store = 0x39; // f64.store m
        public const byte I32Store8 = 0x3A; // i32.store8 m
        public const byte I32Store16 = 0x3B; // i32.store16 m
        public const byte I64Store8 = 0x3C; // i64.store8 m
        public const byte I64Store16 = 0x3D; // i64.store16 m
        public const byte I64Store32 = 0x3E; // i64.store32 m
        public const byte MemorySize = 0x3F; // memory.size
        public const byte MemoryGrow = 0x40; // memory.grow
        public const byte I32Const = 0x41; // i32.const n
        public const byte I64Const = 0x42; // i64.const n
        public const byte F32Const = 0x43; // f32.const z
        public const byte F64Const = 0x44; // f64.const z
        public const byte I32Eqz = 0x45; // i32.eqz
        public const byte I32Eq = 0x46; // i32.eq
        public const byte I32Ne = 0x47; // i32.ne
        public const byte I32LtS = 0x48; // i32.lt_s
        public const byte I32LtU = 0x49; // i32.lt_u
        public const byte I32GtS = 0x4A; // i32.gt_s
        public const byte I32GtU = 0x4B; // i32.gt_u
        public const byte I32LeS = 0x4C; // i32.le_s
        public const byte I32LeU = 0x4D; // i32.le_u
        public const byte I32GeS = 0x4E; // i32.ge_s
        public const byte I32GeU = 0x4F; // i32.ge_u
        public const byte I64Eqz = 0x50; // i64.eqz
        public const byte I64Eq = 0x51; // i64.eq
        public const byte I64Ne = 0x52; // i64.ne
        public const byte I64LtS = 0x53; // i64.lt_s
        public const byte I64LtU = 0x54; // i64.lt_u
        public const byte I64GtS = 0x55; // i64.gt_s
        public const byte I64GtU = 0x56; // i64.gt_u
        public const byte I64LeS = 0x57; // i64.le_s
        public const byte I64LeU = 0x58; // i64.le_u
        public const byte I64GeS = 0x59; // i64.ge_s
        public const byte I64GeU = 0x5A; // i64.ge_u
        public const byte F32Eq = 0x5B; // f32.eq
        public const byte F32Ne = 0x5C; // f32.ne
        public const byte F32Lt = 0x5D; // f32.lt
        public const byte F32Gt = 0x5E; // f32.gt
        public const byte F32Le = 0x5F; // f32.le
        public const byte F32Ge = 0x60; // f32.ge
        public const byte F64Eq = 0x61; // f64.eq
        public const byte F64Ne = 0x62; // f64.ne
        public const byte F64Lt = 0x63; // f64.lt
        public const byte F64Gt = 0x64; // f64.gt
        public const byte F64Le = 0x65; // f64.le
        public const byte F64Ge = 0x66; // f64.ge
        public const byte I32Clz = 0x67; // i32.clz
        public const byte I32Ctz = 0x68; // i32.ctz
        public const byte I32PopCnt = 0x69; // i32.popcnt
        public const byte I32Add = 0x6A; // i32.add
        public const byte I32Sub = 0x6B; // i32.sub
        public const byte I32Mul = 0x6C; // i32.mul
        public const byte I32DivS = 0x6D; // i32.div_s
        public const byte I32DivU = 0x6E; // i32.div_u
        public const byte I32RemS = 0x6F; // i32.rem_s
        public const byte I32RemU = 0x70; // i32.rem_u
        public const byte I32And = 0x71; // i32.and
        public const byte I32Or = 0x72; // i32.or
        public const byte I32Xor = 0x73; // i32.xor
        public const byte I32Shl = 0x74; // i32.shl
        public const byte I32ShrS = 0x75; // i32.shr_s
        public const byte I32ShrU = 0x76; // i32.shr_u
        public const byte I32Rotl = 0x77; // i32.rotl
        public const byte I32Rotr = 0x78; // i32.rotr
        public const byte I64Clz = 0x79; // i64.clz
        public const byte I64Ctz = 0x7A; // i64.ctz
        public const byte I64PopCnt = 0x7B; // i64.popcnt
        public const byte I64Add = 0x7C; // i64.add
        public const byte I64Sub = 0x7D; // i64.sub
        public const byte I64Mul = 0x7E; // i64.mul
        public const byte I64DivS = 0x7F; // i64.div_s
        public const byte I64DivU = 0x80; // i64.div_u
        public const byte I64RemS = 0x81; // i64.rem_s
        public const byte I64RemU = 0x82; // i64.rem_u
        public const byte I64And = 0x83; // i64.and
        public const byte I64Or = 0x84; // i64.or
        public const byte I64Xor = 0x85; // i64.xor
        public const byte I64Shl = 0x86; // i64.shl
        public const byte I64ShrS = 0x87; // i64.shr_s
        public const byte I64ShrU = 0x88; // i64.shr_u
        public const byte I64Rotl = 0x89; // i64.rotl
        public const byte I64Rotr = 0x8A; // i64.rotr
        public const byte F32Abs = 0x8B; // f32.abs
        public const byte F32Neg = 0x8C; // f32.neg
        public const byte F32Ceil = 0x8D; // f32.ceil
        public const byte F32Floor = 0x8E; // f32.floor
        public const byte F32Trunc = 0x8F; // f32.trunc
        public const byte F32Nearest = 0x90; // f32.nearest
        public const byte F32Sqrt = 0x91; // f32.sqrt
        public const byte F32Add = 0x92; // f32.add
        public const byte F32Sub = 0x93; // f32.sub
        public const byte F32Mul = 0x94; // f32.mul
        public const byte F32Div = 0x95; // f32.div
        public const byte F32Min = 0x96; // f32.min
        public const byte F32Max = 0x97; // f32.max
        public const byte F32CopySign = 0x98; // f32.copysign
        public const byte F64Abs = 0x99; // f64.abs
        public const byte F64Neg = 0x9A; // f64.neg
        public const byte F64Ceil = 0x9B; // f64.ceil
        public const byte F64Floor = 0x9C; // f64.floor
        public const byte F64Trunc = 0x9D; // f64.trunc
        public const byte F64Nearest = 0x9E; // f64.nearest
        public const byte F64Sqrt = 0x9F; // f64.sqrt
        public const byte F64Add = 0xA0; // f64.add
        public const byte F64Sub = 0xA1; // f64.sub
        public const byte F64Mul = 0xA2; // f64.mul
        public const byte F64Div = 0xA3; // f64.div
        public const byte F64Min = 0xA4; // f64.min
        public const byte F64Max = 0xA5; // f64.max
        public const byte F64CopySign = 0xA6; // f64.copysign
        public const byte I32WrapI64 = 0xA7; // i32.wrap_i64
        public const byte I32TruncF32S = 0xA8; // i32.trunc_f32_s
        public const byte I32TruncF32U = 0xA9; // i32.trunc_f32_u
        public const byte I32TruncF64S = 0xAA; // i32.trunc_f64_s
        public const byte I32TruncF64U = 0xAB; // i32.trunc_f64_u
        public const byte I64ExtendI32S = 0xAC; // i64.extend_i32_s
        public const byte I64ExtendI32U = 0xAD; // i64.extend_i32_u
        public const byte I64TruncF32S = 0xAE; // i64.trunc_f32_s
        public const byte I64TruncF32U = 0xAF; // i64.trunc_f32_u
        public const byte I64TruncF64S = 0xB0; // i64.trunc_f64_s
        public const byte I64TruncF64U = 0xB1; // i64.trunc_f64_u
        public const byte F32ConvertI32S = 0xB2; // f32.convert_i32_s
        public const byte F32ConvertI32U = 0xB3; // f32.convert_i32_u
        public const byte F32ConvertI64S = 0xB4; // f32.convert_i64_s
        public const byte F32ConvertI64U = 0xB5; // f32.convert_i64_u
        public const byte F32DemoteF64 = 0xB6; // f32.demote_f64
        public const byte F64ConvertI32S = 0xB7; // f64.convert_i32_s
        public const byte F64ConvertI32U = 0xB8; // f64.convert_i32_u
        public const byte F64ConvertI64S = 0xB9; // f64.convert_i64_s
        public const byte F64ConvertI64U = 0xBA; // f64.convert_i64_u
        public const byte F64PromoteF32 = 0xBB; // f64.promote_f32
        public const byte I32ReinterpretF32 = 0xBC; // i32.reinterpret_f32
        public const byte I64ReinterpretF64 = 0xBD; // i64.reinterpret_f64
        public const byte F32ReinterpretI32 = 0xBE; // f32.reinterpret_i32
        public const byte F64ReinterpretI64 = 0xBF; // f64.reinterpret_i64
        public const byte I32Extend8S = 0xC0; // i32.extend8_s
        public const byte I32Extend16S = 0xC1; // i32.extend16_s
        public const byte I64Extend8S = 0xC2; // i64.extend8_s
        public const byte I64Extend16S = 0xC3; // i64.extend16_s
        public const byte I64Extend32S = 0xC4; // i64.extend32_s
        public const byte TruncSat = 0xFC; // <i32|64>.trunc_sat_<f32|64>_<s|u>
    }
}